package com.baymax.test.scene.demo

import android.opengl.GLES20
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.view.setPadding
import com.baymax.test.scene.BaseScene
import com.baymax.test.scene.addDFView
import com.baymax.test.scene.installLogger
import com.baymax.test.scene.newFlexContainer
import com.baymax.test.scene.newScrollContainer
import com.baymax.test.scene.view.TestGLSurfaceView

class OpenGLScene : BaseScene() {
    override fun onCreateView(p0: LayoutInflater, p1: ViewGroup, p2: Bundle?): View {
        return p1.newScrollContainer() {
            val scene = this@OpenGLScene
            val ctx = requireActivity()
            addView(TextView(ctx))

            val logger = scene.installLogger(this)

            newFlexContainer {
                setPadding(30)
                val gl = TestGLSurfaceView(ctx)
                addDFView(v = gl) {

                }

            }
        }
    }
}